home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
cstdio.arc
/
SRC.ARC
/
FNSTIM.C
< prev
next >
Wrap
C/C++ Source or Header
|
1985-10-14
|
1KB
|
64 lines
/* fnstim.c - time functions.
(C) Copyright 1983 Gregory R. Mansfield - All Rights Reserved.
G. R. Mansfield. 83/11/27.
Ver 1.2-5A14.
*/
#include <defstd.h>
#include <time.h>
char *cclock()
{
}
char *ddate()
{
}
struct tm *localtime(clock)
long clock;
{
static struct tm ltm;
static BYTE mondays[12] = {
0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334
};
int *p;
int i, j;
mstim(<m);
ltm->tm_year -= 1900;
if (ltm->tm_year != 100)
if ((ltm->tm_year & 3) == 0)
mondays[2]++;
ltm->tm_yday = mondays[ltm->tm_mon] + ltm->tm_mday;
ltm->tm_isdst = 1;
return(ltm);
}
char *ctime(clock)
long clock;
{
struct tm tm;
char *asctime();
mstim(&tm);
return(asctime(&tm));
}
char *asctime(tm)
struct tm *tm;
{
static char *mon[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
"Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
};
static char *wday[] = {
"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
};
static char tbuf[26];
sprintf(tbuf, "%s %s %02d %02d:%02d:%02d %d\n", wday[tm->tm_wday],
mon[tm->tm_mon], tm->tm_mday, tm->tm_hour, tm->tm_min,
tm->tm_sec, tm->tm_year);
return(tbuf);
}